<?php
class CheckboxElement extends GroupElement {
	
	public function __construct($elementId, $text) {
		
		parent::__construct($elementId, $text);
	}
	
	protected function renderElement() {
		
		$checked = '';
		
		if ($this->selected) {
			$checked = 'checked="checked"';
		}
		
		echo '<input type="checkbox" name="', $this->elementId, '" class="custom" ', $checked, ' ', $this->formatAttributes(), ' />';
		echo '<label for="', $this->elementId, '">', $this->text, '</label>';
	}
}
?>